// app.js
App({
  globalData: {
    userInfo: null,
    userInfoReadyCallback: null,
    drawConfig: {
      title: '',
      totalCount: 0,
      winnerCount: 0
    }
  },
  onLaunch() {
    console.log('应用启动')
    // 获取用户信息
    wx.getSetting({
      success: res => {
        if (res.authSetting['scope.userInfo']) {
          wx.getUserInfo({
            success: res => {
              this.globalData.userInfo = res.userInfo
              if (this.userInfoReadyCallback) {
                this.userInfoReadyCallback(res)
              }
            }
          })
        }
      }
    })
  }
}) 